package com.project.thisDatabase.base.model;

public class BaseUpdateEntity<T> {
    private T condition;
    private T content;

    public T getCondition() {
        return condition;
    }

    public void setCondition(T condition) {
        this.condition = condition;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    public void bind(T content) {
        try {
            setCondition((T)content.getClass().newInstance());
            setContent(content);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void bindNone(T condition) {
        try {
            setCondition(condition);
            setContent((T)condition.getClass().newInstance());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
